-
Notifications
You must be signed in to change notification settings - Fork 2.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
Accept- or Deny-Link of Notifications Lack Webroot Part #22786
Comments
@dragotin mind posting a link to that showstopper ticket, for reference ? |
@nickvergessen I suppose that if the links are wrong they also wouldn't work properly in the web UI ? |
the client issue is owncloud/client#3733 Indeed, the webinterface does also not work. |
Strange. If OC webroot is broken, then many other things should be broken as well. |
Well, I assume its only in my installation for some reason, otherwise more people would have spotted it I guess... |
I tried this locally on my dev instance with a config closer to yours:
Then I accepted a fed share in the web UI and checked the network console. |
This was when creating and accepting the share using the first trusted domain "http://localhost/owncloud!. I then tried again creating the share with "http://laptop.vincentpetry.net/owncloud". After that, if I open the notifications from that domain, the URL points to the other domain: http://localhost/owncloud/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/3 Looks like this could be yet another issue. The webroot part is there but the domain is different. @dragotin which URL did you use when testing, the one with "localhost" or the IP ? You might be able to quickfix this by removing "localhost" from the trusted domain list. |
@PVince81 I used the IP type consistently because I have a mitmproxy in between. Now I changed the trusted domain array to contain the IP only, but still the same effect: Accept and deny url are without webroot. |
Btw you need to newly create a remote share all the time, because URLs are generated on sharing, not on reading notifications. |
yes. Retried with a different folder to make sure but same result, read from table |
Btw you are missing the "Steps" section in your report. |
@nickvergessen: I type |
Tested again with this config file:
and adding a share user
as you see, the |
and finally tried again with the ip address as sharee like |
Does it work without mitmproxy ? How did you configure mitmproxy ? |
Now I set up a similar setup from git on a different machine with core on SHA 19dc02b . The ownCloud is reachable at http://localhost/oc. No mitmproxy involved, I end up with exactly the same Accept- and Decline links as on the other machine, missing the webroot path |
Did you also try with only using localhost, without any "overwrite*" settings ? I tried the SHA you mentionned with stable9 branch of notifications app. The URL is correct in both the web UI network console and CLI:
I shared from user "admin" to "vincent@localhost/owncloud". Do you have any redirects or proxy settings in your Apache config ? |
@dragotin try this:
In my case, the output looks like this:
|
This is my output:
|
It really is a bug in core existent since ownCloud 7.0.0. 6292aa5 added a check to So in case ownCloud is installed under Let me think how we can fix that without breaking other stuff. Best solution would be to remove this "feature". It really does more harm than good. |
check for |
6292aa5 added a check to `\OCP\IURLGenerator::getAbsoluteURL($url)` whether `OC::$WEBROOT` is already prepended to `$url`. It does this kinda naively and is thus error prone. So in case ownCloud is installed under `/oc`, `OC::$WEBROOT` will be `/oc`, then the URL generator checks `substr($url, 0, strlen(\OC::$WEBROOT)) === \OC::$WEBROOT`. Since `$url` is `/ocs/apps/notifications/` it will now compare `/oc` with `/oc` and won't append the webroot => 💣 Considering that this is rather a very error prone feature which is not used from a search over the core code I'd recommend to remove this logic. Fixes #22786
I'd recommend to get rid of this in total. Whoever calls PR at #22954. Let's discuss there… |
hmm, actually I often have installations in |
I'd more say that the actual reason is that |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
A GET to
ocs/v2.php/apps/notifications/api/v1/notifications?format=json
returns a json list of notifications if there are any, for example because a remote share was done for you.On my installation, which lives in http://ip/oc/, the returned accpet- and deny-links look like
As one can easily spot, the
link
does not contain the oc which is the webroot of the ownCloud. That is the problem.I drilled that down to function
public function getAbsoluteURL($url)
inlib/private/urlgenerator.php
, it seems that \OC::WEBROOT is empty there for some reason on that installation.Expected behaviour
The Accept- or Deny-Link of a notification should contain the webroot
Actual behaviour
Tell us what happens instead: it does not.
Server configuration
Where did you install ownCloud from:
git SHA 2773b2b
List of activated apps:
The content of config/config.php:
@nickvergessen @LukasReschke
Needless to say that this blocks a client gold ticket, so please handle with high severity.
The text was updated successfully, but these errors were encountered: