-
-
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
Config Param 'overwritecondaddr' not working #6914
Comments
dots are not escaped. Please have a second look at the doc
Does it help? |
Hello, no - that does not help. I already 'dotted' the Look at the code in https://github.com/nextcloud/server/blob/master/lib/private/AppFramework/Http/Request.php -- there is the expression: $this->isOverwriteCondition() with empty params within getOverwriteHost() -- which always returns true - what is not what we should expect... (in my understanding)
so a call to:
always returns the configured value and so hostname replacement always takes place. Even if it should not be the case. |
Alright then, can anybody make some hotfixes according this bugs? ;) |
I think two things need to be fixed here:
I could try to come up with a patch, but I'm not sure how this could be fixed. The easiest solution could be to change how overwritecondaddr works (or introduce a new config parameter), in a sense that the new/changed parameter should be a regex for the ips that either should or should not be overwritten (i.e. e.g. LAN (do not overwrite) or WAN (do overwrite)), but this would require everybody who uses this to reconfigure their nextcloud installation -- probably something that is not appreciated :-) |
@danielwbn you can simply drop |
I'm surprised this hasn't been addressed already. Is anyone working on this, or should I take a swing at it? |
Please :) |
+1 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Could I get access to your repo to be able to push a branch/pull request with a fix? Note: why was my yesterday comment marked as 'spam' |
You don't need to have push access to create a pull request. You can do the changes in your fork and open a PR against this repo. You'll be invited nevertheless.
The content of the comment was not exactly providing value to this issue. The commandeering question (as i perceived it) was rude. Open source software means to make the software work for you needs and contribute back the enhancements or fixed, but not demanding work done. |
Thanks for the instructions, I've just created the PR, so I would be pleased if somebody can have a look at it.
Well, I don't see much difference between @Nero10578's last comment and mine. But that's not important, I guess. |
Thank your for the PR!
Fixed ;) |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Hey All, |
+1. The issue still exists also in NC 27! |
I still have this issue! |
- just ignoring/removing extra parameter 'protocol' as suggested by blizzz Signed-off-by: Pavel Kryl <[email protected]>
- just ignoring/removing extra parameter 'protocol' as suggested by blizzz Signed-off-by: Pavel Kryl <[email protected]>
- just ignoring/removing extra parameter 'protocol' as suggested by blizzz Signed-off-by: Pavel Kryl <[email protected]>
- just ignoring/removing extra parameter 'protocol' as suggested by blizzz Signed-off-by: Pavel Kryl <[email protected]>
- just ignoring/removing extra parameter 'protocol' as suggested by blizzz Signed-off-by: Pavel Kryl <[email protected]>
- just ignoring/removing extra parameter 'protocol' as suggested by blizzz Signed-off-by: Pavel Kryl <[email protected]>
Steps to reproduce
'overwritehost' => 'my.domain.com',
'overwritecondaddr' => '^192.168.0.1$',
Expected behaviour
Hostname should be overwritten when request comes in via 192.168.0.1, otherwise NOT.
Actual behaviour
Hostname is always overwritten
Server configuration
Operating system:
official Docker Image on different Docker Hosts
Nextcloud version: (see Nextcloud admin page)
12.0.3.3
Updated from an older Nextcloud/ownCloud or fresh install:
fresh
Where did you install Nextcloud from:
docker
Nextcloud configuration:
Config report
Code causing Troubles...
Problem is in File .../lib/private/AppFramework/Http/Request.php in Method 'private function isOverwriteCondition($type = '')' ... type is empty when checking for e.g. Host-Override in Method 'getOverwriteHost' ... so with empty type check override method (isOverwriteCondition) always returns true cause of:
...
return $regex === '//' || preg_match($regex, $remoteAddr) === 1 || $type !== 'protocol';
...
-> type === '' ... so $type !== 'protocol' is always true ... so method always returns true in this case.
The text was updated successfully, but these errors were encountered: