Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-06-13 12:45:49 +0300
committerMorris Jobke <hey@morrisjobke.de>2018-06-13 16:25:08 +0300
commit9c4aecb53956df33ef16c51f6a195320b1032d58 (patch)
tree0cd5fba6a0399e5d0eb934c6adab6d8507f3eb93 /core/js
parentcd87a40eb3a2b7026dfd1822e6e43e131edd3423 (diff)
Merge all setup checks into one controller
* renamed hasMissingIndexes to missingIndexes Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/js')
-rw-r--r--core/js/setupchecks.js83
-rw-r--r--core/js/tests/specs/setupchecksSpec.js130
2 files changed, 201 insertions, 12 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index 6e1c993b3bc..eae0abae50c 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -92,6 +92,85 @@
var afterCall = function(data, statusText, xhr) {
var messages = [];
if (xhr.status === 200 && data) {
+ if (!data.isGetenvServerWorking) {
+ messages.push({
+ msg: t('core', 'PHP does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.') + ' ' +
+ t(
+ 'core',
+ 'Please check the <a target="_blank" rel="noreferrer noopener" href="{docLink}">installation documentation ↗</a> for PHP configuration notes and the PHP configuration of your server, especially when using php-fpm.',
+ {
+ docLink: oc_defaults.docPlaceholderUrl.replace('PLACEHOLDER', 'admin-php-fpm')
+ }
+ ),
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ });
+ }
+ if (data.isReadOnlyConfig) {
+ messages.push({
+ msg: t('core', 'The read-only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update.'),
+ type: OC.SetupChecks.MESSAGE_TYPE_INFO
+ });
+ }
+ 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.outdatedCaches.length > 0) {
+ data.outdatedCaches.forEach(function(element){
+ messages.push({
+ msg: t(
+ 'core',
+ '{name} below version {version} is installed, for stability and performance reasons it is recommended to update to a newer {name} version.',
+ element
+ ),
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ })
+ });
+ }
+ 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 <a target="_blank" rel="noreferrer noopener" href="{docLink}">documentation ↗</a> for more information.', {docLink: oc_defaults.docPlaceholderUrl.replace('PLACEHOLDER', 'admin-transactional-locking')}),
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ });
+ }
+ if (data.suggestedOverwriteCliURL !== '') {
+ messages.push({
+ msg: t('core', 'If your installation is not installed at the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the "overwrite.cli.url" option in your config.php file to the webroot path of your installation (suggestion: "{suggestedOverwriteCliURL}")', {suggestedOverwriteCliURL: data.suggestedOverwriteCliURL}),
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ });
+ }
+ if (data.cronErrors.length > 0) {
+ var listOfCronErrors = "";
+ data.cronErrors.forEach(function(element){
+ listOfCronErrors += "<li>";
+ listOfCronErrors += element.error;
+ listOfCronErrors += ' ';
+ listOfCronErrors += element.hint;
+ listOfCronErrors += "</li>";
+ });
+ messages.push({
+ msg: t(
+ 'core',
+ 'It was not possible to execute the cron job via CLI. The following technical errors have appeared:'
+ ) + "<ul>" + listOfCronErrors + "</ul>",
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ })
+ }
+ if (data.cronInfo.diffInSeconds > 3600) {
+ messages.push({
+ msg: t('core', 'Last background job execution ran {relativeTime}. Something seems wrong.', {relativeTime: data.cronInfo.relativeTime}) +
+ ' <a href="' + data.cronInfo.backgroundJobsUrl + '">' + t('core', 'Check the background job settings') + '</a>',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ });
+ }
if (!data.serverHasInternetConnection) {
messages.push({
msg: t('core', '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.'),
@@ -183,9 +262,9 @@
type: OC.SetupChecks.MESSAGE_TYPE_INFO
})
}
- if (data.hasMissingIndexes.length > 0) {
+ if (data.missingIndexes.length > 0) {
var listOfMissingIndexes = "";
- data.hasMissingIndexes.forEach(function(element){
+ data.missingIndexes.forEach(function(element){
listOfMissingIndexes += "<li>";
listOfMissingIndexes += t('core', 'Missing index "{indexName}" in table "{tableName}".', element);
listOfMissingIndexes += "</li>";
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index 316b5d4c592..900b9f8fc66 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -149,6 +149,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json'
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: true,
serverHasInternetConnection: false,
memcacheDocs: 'https://docs.nextcloud.com/server/go.php?to=admin-performance',
@@ -158,7 +164,12 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);
@@ -184,6 +195,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json'
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: true,
serverHasInternetConnection: false,
memcacheDocs: 'https://docs.nextcloud.com/server/go.php?to=admin-performance',
@@ -193,7 +210,12 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);
@@ -220,6 +242,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json',
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: true,
serverHasInternetConnection: false,
isMemcacheConfigured: true,
@@ -229,7 +257,12 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);
@@ -253,6 +286,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json',
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: false,
securityDocs: 'https://docs.owncloud.org/myDocs.html',
serverHasInternetConnection: true,
@@ -263,7 +302,12 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);
@@ -285,6 +329,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json',
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: true,
securityDocs: 'https://docs.owncloud.org/myDocs.html',
serverHasInternetConnection: true,
@@ -295,7 +345,12 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);
@@ -317,6 +372,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json',
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: true,
serverHasInternetConnection: true,
isMemcacheConfigured: true,
@@ -327,7 +388,12 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);
@@ -349,6 +415,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json',
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: true,
serverHasInternetConnection: true,
isMemcacheConfigured: true,
@@ -359,7 +431,12 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: true,
isSettimelimitAvailable: false,
hasFreeTypeSupport: true,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);
@@ -401,6 +478,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json',
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: true,
securityDocs: 'https://docs.owncloud.org/myDocs.html',
serverHasInternetConnection: true,
@@ -412,7 +495,12 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);
@@ -434,6 +522,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json'
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: true,
securityDocs: 'https://docs.owncloud.org/myDocs.html',
serverHasInternetConnection: true,
@@ -445,7 +539,12 @@ describe('OC.SetupChecks tests', function() {
phpOpcacheDocumentation: 'https://example.org/link/to/doc',
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);
@@ -467,6 +566,12 @@ describe('OC.SetupChecks tests', function() {
'Content-Type': 'application/json'
},
JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
isUrandomAvailable: true,
securityDocs: 'https://docs.owncloud.org/myDocs.html',
serverHasInternetConnection: true,
@@ -478,7 +583,12 @@ describe('OC.SetupChecks tests', function() {
phpOpcacheDocumentation: 'https://example.org/link/to/doc',
isSettimelimitAvailable: true,
hasFreeTypeSupport: false,
- hasMissingIndexes: []
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ }
})
);