diff options
Diffstat (limited to 'core/js/tests/specs/setupchecksSpec.js')
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 182 |
1 files changed, 142 insertions, 40 deletions
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 5e93cbf7bdf..a5e55a21209 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -62,13 +62,13 @@ describe('OC.SetupChecks tests', function() { describe('checkWellKnownUrl', function() { it('should fail with another response status code than the expected one', function(done) { - var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', 'http://example.org/PLACEHOLDER', true, 207); + var async = OC.SetupChecks.checkWellKnownUrl('PROPFIND', '/.well-known/caldav', 'http://example.org/PLACEHOLDER', true, 207); suite.server.requests[0].respond(200); async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the <a href="http://example.org/admin-setup-well-known-URL" rel="noreferrer noopener">documentation</a>.', + msg: 'Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the <a target="_blank" rel="noreferrer noopener" class="external" href="http://example.org/admin-setup-well-known-URL">documentation ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -76,7 +76,7 @@ describe('OC.SetupChecks tests', function() { }); it('should return no error with the expected response status code', function(done) { - var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', 'http://example.org/PLACEHOLDER', true, 207); + var async = OC.SetupChecks.checkWellKnownUrl('PROPFIND', '/.well-known/caldav', 'http://example.org/PLACEHOLDER', true, 207); suite.server.requests[0].respond(207); @@ -87,7 +87,7 @@ describe('OC.SetupChecks tests', function() { }); it('should return no error with the default expected response status code', function(done) { - var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', 'http://example.org/PLACEHOLDER', true); + var async = OC.SetupChecks.checkWellKnownUrl('PROPFIND', '/.well-known/caldav', 'http://example.org/PLACEHOLDER', true); suite.server.requests[0].respond(207); @@ -98,7 +98,7 @@ describe('OC.SetupChecks tests', function() { }); it('should return no error when no check should be run', function(done) { - var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', 'http://example.org/PLACEHOLDER', false); + var async = OC.SetupChecks.checkWellKnownUrl('PROPFIND', '/.well-known/caldav', 'http://example.org/PLACEHOLDER', false); async.done(function( data, s, x ){ expect(data).toEqual([]); @@ -115,7 +115,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'Your web server is not properly set up to resolve "/ocm-provider/". This is most likely related to a web server configuration that was not updated to deliver this folder directly. Please compare your configuration against the shipped rewrite rules in ".htaccess" for Apache or the provided one in the documentation for Nginx at it\'s <a href="http://example.org/admin-nginx" rel="noreferrer noopener">documentation page</a>. On Nginx those are typically the lines starting with "location ~" that need an update.', + msg: 'Your web server is not properly set up to resolve "/ocm-provider/". This is most likely related to a web server configuration that was not updated to deliver this folder directly. Please compare your configuration against the shipped rewrite rules in ".htaccess" for Apache or the provided one in the documentation for Nginx at it\'s <a target="_blank" rel="noreferrer noopener" class="external" href="http://example.org/admin-nginx">documentation page ↗</a>. On Nginx those are typically the lines starting with "location ~" that need an update.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -151,7 +151,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'Your web server is not properly set up to deliver .woff2 files. This is typically an issue with the Nginx configuration. For Nextcloud 15 it needs an adjustement to also deliver .woff2 files. Compare your Nginx configuration to the recommended configuration in our <a href="http://example.org/admin-nginx" rel="noreferrer noopener">documentation</a>.', + msg: 'Your web server is not properly set up to deliver .woff2 files. This is typically an issue with the Nginx configuration. For Nextcloud 15 it needs an adjustement to also deliver .woff2 files. Compare your Nginx configuration to the recommended configuration in our <a target="_blank" rel="noreferrer noopener" class="external" href="http://example.org/admin-nginx">documentation ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -240,6 +240,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -249,6 +251,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -260,7 +263,7 @@ describe('OC.SetupChecks tests', function() { msg: 'This server has no working Internet connection: Multiple endpoints could not be reached. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. Establish a connection from this server to the Internet to enjoy all features.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }, { - msg: 'No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the <a href="https://docs.nextcloud.com/server/go.php?to=admin-performance" rel="noreferrer noopener">documentation</a>.', + msg: 'No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.nextcloud.com/server/go.php?to=admin-performance">documentation ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -293,6 +296,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -302,6 +307,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -314,7 +320,7 @@ describe('OC.SetupChecks tests', function() { type: OC.SetupChecks.MESSAGE_TYPE_WARNING }, { - msg: 'No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the <a href="https://docs.nextcloud.com/server/go.php?to=admin-performance" rel="noreferrer noopener">documentation</a>.', + msg: 'No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.nextcloud.com/server/go.php?to=admin-performance">documentation ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -347,6 +353,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -356,6 +364,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -388,7 +397,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: false, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -399,6 +408,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -408,6 +419,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -415,7 +427,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'No suitable source for randomness found by PHP which is highly discouraged for security reasons. Further information can be found in the <a href="https://docs.owncloud.org/myDocs.html" rel="noreferrer noopener">documentation</a>.', + msg: 'No suitable source for randomness found by PHP which is highly discouraged for security reasons. Further information can be found in the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.nextcloud.com/myDocs.html">documentation ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_ERROR }]); done(); @@ -438,7 +450,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: true, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -449,6 +461,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -458,6 +472,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -465,7 +480,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: '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 <a href="https://code.google.com/p/memcached/wiki/PHPClientComparison" rel="noreferrer noopener">memcached wiki about both modules</a>.', + msg: '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 <a target="_blank" rel="noreferrer noopener" class="external" href="https://code.google.com/p/memcached/wiki/PHPClientComparison">memcached wiki about both modules ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -488,7 +503,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: true, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -499,6 +514,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -510,6 +527,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -543,7 +561,7 @@ describe('OC.SetupChecks tests', function() { serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: false, - reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html', + reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, @@ -551,6 +569,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -560,6 +580,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -567,7 +588,7 @@ describe('OC.SetupChecks tests', function() { 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 href="https://docs.owncloud.org/foo/bar.html" rel="noreferrer noopener">documentation</a>.', + 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(); @@ -593,7 +614,7 @@ describe('OC.SetupChecks tests', function() { serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, - reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html', + reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, @@ -601,6 +622,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: false, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -610,6 +633,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -643,7 +667,7 @@ describe('OC.SetupChecks tests', function() { serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, - reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html', + reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, @@ -651,6 +675,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -660,6 +686,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -668,7 +695,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ msg: 'The PHP memory limit is below the recommended value of 512MB.', - type: OC.SetupChecks.MESSAGE_TYPE_WARNING + type: OC.SetupChecks.MESSAGE_TYPE_ERROR }]); done(); }); @@ -710,7 +737,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: true, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -722,6 +749,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -731,6 +760,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -738,7 +768,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'You are currently running PHP 5.4.0. Upgrade your PHP version to take advantage of <a href="https://secure.php.net/supported-versions.php" rel="noreferrer noopener">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.', + msg: 'You are currently running PHP 5.4.0. Upgrade your PHP version to take advantage of <a target="_blank" rel="noreferrer noopener" class="external" href="https://secure.php.net/supported-versions.php">performance and security updates provided by the PHP Group ↗</a> as soon as your distribution supports it.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -761,7 +791,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: true, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -773,6 +803,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -782,6 +814,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -789,7 +822,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The PHP OPcache is not properly configured. <a href="https://example.org/link/to/doc" rel="noreferrer noopener">For better performance it is recommended</a> to use the following settings in the <code>php.ini</code>:' + "<pre><code>opcache.enable=1\nopcache.interned_strings_buffer=8\nopcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1</code></pre>", + msg: 'The PHP OPcache module is not properly configured. <a target="_blank" rel="noreferrer noopener" class="external" href="https://example.org/link/to/doc">For better performance it is recommended ↗</a> to use the following settings in the <code>php.ini</code>:' + "<pre><code>opcache.enable=1\nopcache.interned_strings_buffer=8\nopcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1</code></pre>", type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -812,7 +845,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: true, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -824,6 +857,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -833,6 +868,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -840,7 +876,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The PHP OPcache module is not loaded. <a href="https://example.org/link/to/doc" rel="noreferrer noopener">For better performance it is recommended</a> to load it into your PHP installation.', + msg: 'The PHP OPcache module is not loaded. <a target="_blank" rel="noreferrer noopener" class="external" href="https://example.org/link/to/doc">For better performance it is recommended ↗</a> to load it into your PHP installation.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -863,7 +899,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: true, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -875,6 +911,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: false, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -884,6 +922,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -914,7 +953,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: true, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -925,6 +964,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -934,6 +975,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: true, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyGeneratedURL: 'https://server', }) @@ -941,7 +983,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read <a href="https://docs.example.org/admin-mysql-utf8mb4" rel="noreferrer noopener">the documentation page about this</a>.', + msg: 'MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.example.org/admin-mysql-utf8mb4">the documentation page about this ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -964,7 +1006,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: true, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -975,6 +1017,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -984,6 +1028,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', reverseProxyGeneratedURL: 'http://server', @@ -992,7 +1037,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: '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 <a href="https://docs.nextcloud.com/foo/bar.html" rel="noreferrer noopener">the documentation page about this</a>.', + msg: '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 <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.nextcloud.com/foo/bar.html">the documentation page about this ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -1015,7 +1060,7 @@ describe('OC.SetupChecks tests', function() { hasValidTransactionIsolationLevel: true, suggestedOverwriteCliURL: '', isRandomnessSecure: true, - securityDocs: 'https://docs.owncloud.org/myDocs.html', + securityDocs: 'https://docs.nextcloud.com/myDocs.html', serverHasInternetConnectionProblems: false, isMemcacheConfigured: true, forwardedForHeadersWorking: true, @@ -1026,6 +1071,8 @@ describe('OC.SetupChecks tests', function() { isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], cronErrors: [], cronInfo: { diffInSeconds: 0 @@ -1035,6 +1082,7 @@ describe('OC.SetupChecks tests', function() { recommendedPHPModules: [], pendingBigIntConversionColumns: [], isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: false, reverseProxyGeneratedURL: 'https://server', }) @@ -1048,6 +1096,59 @@ describe('OC.SetupChecks tests', function() { done(); }); }); + + it('should return an info if there is no default phone region', 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', + }) + ); + + async.done(function( data, s, x ){ + expect(data).toEqual([{ + msg: 'Your installation has no default phone region set. This is required to validate phone numbers in the profile settings without a country code. To allow numbers without a country code, please add "default_phone_region" with the respective <a target="_blank" rel="noreferrer noopener" class="external" href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements">ISO 3166-1 code ↗</a> of the region to your config file.', + type: OC.SetupChecks.MESSAGE_TYPE_INFO + }]); + done(); + }); + }); }); describe('checkGeneric', function() { @@ -1082,7 +1183,8 @@ describe('OC.SetupChecks tests', function() { { 'Content-Type': 'application/json', 'Strict-Transport-Security': 'max-age=15768000' - } + }, + '{}' ); async.done(function( data, s, x ){ @@ -1107,7 +1209,7 @@ describe('OC.SetupChecks tests', function() { msg: 'The "X-XSS-Protection" HTTP header doesn\'t contain "1; mode=block". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }, { - msg: 'The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the <a href="https://www.w3.org/TR/referrer-policy/" rel="noreferrer noopener">W3C Recommendation ↗</a>.', + msg: 'The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the <a target="_blank" rel="noreferrer noopener" class="external" href="https://www.w3.org/TR/referrer-policy/">W3C Recommendation ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO } ]); @@ -1389,7 +1491,7 @@ describe('OC.SetupChecks tests', function() { result.done(function( data, s, x ){ expect(data).toEqual([ { - msg: 'The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the <a href="https://www.w3.org/TR/referrer-policy/" rel="noreferrer noopener">W3C Recommendation ↗</a>.', + msg: 'The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the <a target="_blank" rel="noreferrer noopener" class="external" href="https://www.w3.org/TR/referrer-policy/">W3C Recommendation ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO } ]); @@ -1415,7 +1517,7 @@ describe('OC.SetupChecks tests', function() { result.done(function( data, s, x ){ expect(data).toEqual([ { - msg: 'The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the <a href="https://www.w3.org/TR/referrer-policy/" rel="noreferrer noopener">W3C Recommendation ↗</a>.', + msg: 'The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the <a target="_blank" rel="noreferrer noopener" class="external" href="https://www.w3.org/TR/referrer-policy/">W3C Recommendation ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO } ]); @@ -1441,7 +1543,7 @@ describe('OC.SetupChecks tests', function() { result.done(function( data, s, x ){ expect(data).toEqual([ { - msg: 'The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the <a href="https://www.w3.org/TR/referrer-policy/" rel="noreferrer noopener">W3C Recommendation ↗</a>.', + msg: 'The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the <a target="_blank" rel="noreferrer noopener" class="external" href="https://www.w3.org/TR/referrer-policy/">W3C Recommendation ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO } ]); @@ -1469,7 +1571,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'Accessing site insecurely via HTTP. You are strongly advised to set up your server to require HTTPS instead, as described in the <a href="https://docs.example.org/admin-security">security tips ↗</a>.', + msg: 'Accessing site insecurely via HTTP. You are strongly advised to set up your server to require HTTPS instead, as described in the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.example.org/admin-security">security tips ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -1516,7 +1618,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the <a rel="noreferrer noopener" href="https://docs.example.org/admin-security">security tips ↗</a>.', + msg: 'The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.example.org/admin-security">security tips ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -1542,7 +1644,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the <a rel="noreferrer noopener" href="https://docs.example.org/admin-security">security tips ↗</a>.', + msg: 'The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.example.org/admin-security">security tips ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -1568,7 +1670,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the <a rel="noreferrer noopener" href="https://docs.example.org/admin-security">security tips ↗</a>.', + msg: 'The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.example.org/admin-security">security tips ↗</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); |