summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2022-03-03 18:08:08 +0100
committerszaimen <szaimen@e.mail.de>2022-03-09 22:26:00 +0100
commit4191a178dd53f2c77b52d845ad802e3d87519564 (patch)
treefe1c574353d25c3866f661e98a00d4be13bddd66
parent787f4f02b361eec1eddf08709905ed4b5d250a48 (diff)
downloadnextcloud-server-4191a178dd53f2c77b52d845ad802e3d87519564.tar.gz
nextcloud-server-4191a178dd53f2c77b52d845ad802e3d87519564.zip
improve overwrite cli url setup check
Signed-off-by: szaimen <szaimen@e.mail.de>
-rw-r--r--apps/settings/lib/Controller/CheckSetupController.php15
-rw-r--r--core/js/setupchecks.js2
2 files changed, 8 insertions, 9 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php
index 11900fad45b..eeaf45d0ec5 100644
--- a/apps/settings/lib/Controller/CheckSetupController.php
+++ b/apps/settings/lib/Controller/CheckSetupController.php
@@ -609,15 +609,14 @@ Raw output
}
protected function getSuggestedOverwriteCliURL(): string {
- $suggestedOverwriteCliUrl = '';
- if ($this->config->getSystemValue('overwrite.cli.url', '') === '') {
- $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT;
- if (!$this->config->getSystemValue('config_is_read_only', false)) {
- // Set the overwrite URL when it was not set yet.
- $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl);
- $suggestedOverwriteCliUrl = '';
- }
+ $currentOverwriteCliUrl = $this->config->getSystemValue('overwrite.cli.url', '');
+ $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT;
+
+ // Check correctness by checking if it is a valid URL
+ if (filter_var($currentOverwriteCliUrl, FILTER_VALIDATE_URL)) {
+ $suggestedOverwriteCliUrl = '';
}
+
return $suggestedOverwriteCliUrl;
}
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index fdeed4897d0..5a926534d9e 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -225,7 +225,7 @@
}
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}),
+ 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}),
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
});
}