aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-11-20 16:12:19 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-11-20 16:12:19 +0100
commit1f4e0927ba0fa586830136ff1f40b62a29d6d629 (patch)
tree693dd4ecfd1e5d0537869c9e6d52c4441aa7ad2c /apps/settings
parentf023216cf47ad2d6e69a16d69718d22e4d06ec2f (diff)
downloadnextcloud-server-1f4e0927ba0fa586830136ff1f40b62a29d6d629.tar.gz
nextcloud-server-1f4e0927ba0fa586830136ff1f40b62a29d6d629.zip
Improve success messages for ForwarderForHeaders setup check
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/lib/SetupChecks/BruteForceThrottler.php4
-rw-r--r--apps/settings/lib/SetupChecks/ForwardedForHeaders.php11
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.'),