mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Make it an error if address is not known and we are not in CLI
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
f47a2bbcae
commit
f023216cf4
2 changed files with 14 additions and 5 deletions
|
|
@ -53,9 +53,13 @@ class BruteForceThrottler implements ISetupCheck {
|
|||
public function run(): SetupResult {
|
||||
$address = $this->request->getRemoteAddress();
|
||||
if ($address === '') {
|
||||
return SetupResult::info(
|
||||
$this->l10n->t('Your remote address could not be determined.')
|
||||
);
|
||||
if (\OC::$CLI) {
|
||||
/* We were called from CLI */
|
||||
return SetupResult::info('Your remote address could not be determined.');
|
||||
} else {
|
||||
/* Should never happen */
|
||||
return SetupResult::error('Your remote address could not be determined.');
|
||||
}
|
||||
} elseif ($this->throttler->showBruteforceWarning($address)) {
|
||||
return SetupResult::error(
|
||||
$this->l10n->t('Your remote address was identified as "%s" and is bruteforce throttled at the moment slowing down the performance of various requests. If the remote address is not your address this can be an indication that a proxy is not configured correctly.', $address),
|
||||
|
|
|
|||
|
|
@ -59,8 +59,13 @@ class ForwardedForHeaders implements ISetupCheck {
|
|||
}
|
||||
|
||||
if (($remoteAddress === '') && ($this->request->getRemoteAddress() === '')) {
|
||||
/* Most likely we were called from CLI */
|
||||
return SetupResult::info('Your remote address could not be determined.');
|
||||
if (\OC::$CLI) {
|
||||
/* We were called from CLI */
|
||||
return SetupResult::info('Your remote address could not be determined.');
|
||||
} else {
|
||||
/* Should never happen */
|
||||
return SetupResult::error('Your remote address could not be determined.');
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($trustedProxies) && $this->request->getHeader('X-Forwarded-Host') !== '') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue