diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/SetupChecks/BruteForceThrottler.php | 4 | ||||
-rw-r--r-- | apps/settings/lib/SetupChecks/ForwardedForHeaders.php | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/apps/settings/lib/SetupChecks/BruteForceThrottler.php b/apps/settings/lib/SetupChecks/BruteForceThrottler.php index 88de5c2c82a..d5d6d42ccba 100644 --- a/apps/settings/lib/SetupChecks/BruteForceThrottler.php +++ b/apps/settings/lib/SetupChecks/BruteForceThrottler.php @@ -55,10 +55,10 @@ class BruteForceThrottler implements ISetupCheck { if ($address === '') { if (\OC::$CLI) { /* We were called from CLI */ - return SetupResult::info('Your remote address could not be determined.'); + return SetupResult::info($this->l10n->t('Your remote address could not be determined.')); } else { /* Should never happen */ - return SetupResult::error('Your remote address could not be determined.'); + return SetupResult::error($this->l10n->t('Your remote address could not be determined.')); } } elseif ($this->throttler->showBruteforceWarning($address)) { return SetupResult::error( diff --git a/apps/settings/lib/SetupChecks/ForwardedForHeaders.php b/apps/settings/lib/SetupChecks/ForwardedForHeaders.php index 47ff51ee05e..fda5f31cee1 100644 --- a/apps/settings/lib/SetupChecks/ForwardedForHeaders.php +++ b/apps/settings/lib/SetupChecks/ForwardedForHeaders.php @@ -53,18 +53,19 @@ class ForwardedForHeaders implements ISetupCheck { public function run(): SetupResult { $trustedProxies = $this->config->getSystemValue('trusted_proxies', []); $remoteAddress = $this->request->getHeader('REMOTE_ADDR'); + $detectedRemoteAddress = $this->request->getRemoteAddress(); if (!\is_array($trustedProxies)) { return SetupResult::error($this->l10n->t('Your trusted_proxies setting is not correctly set, it should be an array.')); } - if (($remoteAddress === '') && ($this->request->getRemoteAddress() === '')) { + if (($remoteAddress === '') && ($detectedRemoteAddress === '')) { if (\OC::$CLI) { /* We were called from CLI */ - return SetupResult::info('Your remote address could not be determined.'); + return SetupResult::info($this->l10n->t('Your remote address could not be determined.')); } else { /* Should never happen */ - return SetupResult::error('Your remote address could not be determined.'); + return SetupResult::error($this->l10n->t('Your remote address could not be determined.')); } } @@ -76,9 +77,9 @@ class ForwardedForHeaders implements ISetupCheck { } if (\in_array($remoteAddress, $trustedProxies, true) && ($remoteAddress !== '127.0.0.1')) { - if ($remoteAddress !== $this->request->getRemoteAddress()) { + if ($remoteAddress !== $detectedRemoteAddress) { /* Remote address was successfuly fixed */ - return SetupResult::success('Working'); + return SetupResult::success($this->l10n->t('Your IP address was resolved as %s', $detectedRemoteAddress)); } else { return SetupResult::warning( $this->l10n->t('The reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If not, this is a security issue and can allow an attacker to spoof their IP address as visible to the Nextcloud.'), |