aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-05-13 12:06:21 +0200
committerGitHub <noreply@github.com>2024-05-13 12:06:21 +0200
commitc31d6b1fdc502844ab907355bb553feb451cdda3 (patch)
tree910a27d3b0489501d5cc3c603a596db081e86a5b /apps
parent99f89bb3de2db83307f27d2f017f41ce26a91d9a (diff)
parent5b5178abe74a4c8be508b87c7c81ac445d4e5d65 (diff)
downloadnextcloud-server-c31d6b1fdc502844ab907355bb553feb451cdda3.tar.gz
nextcloud-server-c31d6b1fdc502844ab907355bb553feb451cdda3.zip
Merge pull request #45262 from nextcloud/check-HttpsUrlGeneration
fix(SetupChecks): Detect CLI mode in HTTPS / URL generator check
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/SetupChecks/HttpsUrlGeneration.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/apps/settings/lib/SetupChecks/HttpsUrlGeneration.php b/apps/settings/lib/SetupChecks/HttpsUrlGeneration.php
index 59f99c801cb..664ad5ec1db 100644
--- a/apps/settings/lib/SetupChecks/HttpsUrlGeneration.php
+++ b/apps/settings/lib/SetupChecks/HttpsUrlGeneration.php
@@ -64,12 +64,19 @@ class HttpsUrlGeneration implements ISetupCheck {
}
$generatedUrl = $this->urlGenerator->getAbsoluteURL('index.php');
if (!str_starts_with($generatedUrl, 'https://')) {
- return SetupResult::warning(
- $this->l10n->t('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.'),
- $this->urlGenerator->linkToDocs('admin-reverse-proxy')
- );
+ if (!\OC::$CLI) {
+ return SetupResult::warning(
+ $this->l10n->t('You are accessing your instance over a secure connection, however your instance is generating insecure URLs. This likely means that your instance is behind a reverse proxy and the Nextcloud `overwrite*` config values are not set correctly.'),
+ $this->urlGenerator->linkToDocs('admin-reverse-proxy')
+ );
+ /* We were called from CLI so we can't be 100% sure which scenario is applicable */
+ } else {
+ return SetupResult::info(
+ $this->l10n->t('Your instance is generating insecure URLs. If you access your instance over HTTPS, this likely means that your instance is behind a reverse proxy and the Nextcloud `overwrite*` config values are not set correctly.'),
+ $this->urlGenerator->linkToDocs('admin-reverse-proxy')
+ );
+ }
}
-
return SetupResult::success($this->l10n->t('You are accessing your instance over a secure connection, and your instance is generating secure URLs.'));
}
}