-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stable28] fix(settings): Also verify that trusted_proxies
only contains IP addresses (with range)
#44495
Conversation
…dresses (with range) Co-authored-by: Côme Chilliet <[email protected]> Signed-off-by: Ferdinand Thiessen <[email protected]>
Just updated and got the error: I'm using docker and my proxy (container name swag) and nextcloud (container name nextcloud) containers are in the same docker compose file on same docker network so setting the trusted proxy in config.php to 'swag' has always worked perfectly without requiring the trusted proxy to be an IP address.
Can you please confirm if the check does not actually perform a function check, but only looks at the values in config.php and then complains if it finds anything other than IP addresses? If this is the case then I assume I can leave my trusted proxy as 'swag' and safely ignore the new error? Much appreciate a timely response. Thank you. |
@whisperdancer The code worked because the Meaning your proxy was considered the end user IP, so brute-force protection etc would block your proxy instead of bad user. |
However you could do this:
|
Thanks so much for clearing this up. I've been running this incorrectly for a long time. Your new check along with your suggestion has my nextcloud running as it should now. The use of However, unsure what you mean by this statement? ..."(the value of the header field is also only a list of IPs there are never host names involved)...
|
No, it is just about the For |
Wonderful, much appreciate the clarification! :) |
hi, I just pulled the latest version of the 29.0.0.19 and noticed that my trusted_proxies stopped working. so I used to have
in my docker compose file which translated to
now I wanted to have any thoughts? edit:
but it still reports an error "Your "trusted_proxies" setting is not correctly set, it should be an array of IP addresses" edit 2:
and still getting the same error... |
Yes because it is a string, you need:
Do this change manually or report this issue at the docker repo: https://github.com/nextcloud/docker |
I'm also having issues with this error message as well. I'm assuming that the
|
What if we are using Cloudflare tunnel? Do i need to add all Cloudflare IP's? Solution to add 0 => 'gethostbyname('proxy')', fails. THX |
@techgeeksvk it was never working, as the header only uses IPs not host names.
Do not use quotation marks there, So it should look like: // config.php
// ...
'trusted_proxies' => array(
0 => gethostbyname('my-proxy'),
),
// ... |
Thanks but what proxy do I use when I am connected via tunnel u see. Do I need to use Cloudflare ip's? Docker with Nextcloud is directly connected via tunnel. Maybe I am forgetting something. |
My proxy server has a static IP and I have the following line in my config.php:
However I still get the trusted_proxies error. When I run:
It returns the hostname, and not the IP address that I specified in the config.php file. Could that configuration directive have been specified somewhere else? Is it reverse DNS messing me up? I do have a PTR record for that IP on my DNS server. I was able to resolve my problem with the following command:
It appears to persist through container reboots, but I do not see where that value was set. |
Ok but what dns provider are you using? |
The IP should never be resolved to a hostname, are you sure you have no other config that injects |
Builtin router DNS resolver, I believe it's unbound. |
I do not think so, I grepped all the files in the config directory and that yields no results for the hostname of the proxy server. Interestingly neither does grepping for the ip address that I set via the php occ config:system:set command. It looks like the setting is saved, it is persisting somehow, but it's not in the config directory. |
Hello everyone, |
Please use the forums for help: https://help.nextcloud.com/ |
No Idea where this error is emerging from and obviously the #44495 did not fix the issue as I installed App Version: 29.0.0 |
Sorry, came from another thread. Constant repeating of:
None of the tips above work for me. |
Hello, I checked in my config.php and I have this: Can you help me to solve the problem ? |
Remove that line, if you need that as a trusted proxy either use the static IP address of that server or try: 'trusted_proxies' => [
gethostbyname('your.domain'),
'ip.of.your.server'
] This field only supports IP addresses, no hostnames so you need to resolve any hostname previously. |
Backport of PR #44483