mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 10:00:33 -04:00
fix(SetupChecks): Detect CLI mode in HTTPS / URL generator check
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
This commit is contained in:
parent
0d52697f8f
commit
5b5178abe7
1 changed files with 12 additions and 5 deletions
|
|
@ -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.'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue