core icon indicating copy to clipboard operation
core copied to clipboard

HTTP links are send in share mail if reverse proxy is used and the webserver just uses HTTP

Open MorrisJobke opened this issue 11 years ago • 11 comments

  • HTTPS links to the reverse proxy should be send.

@finius wrote in https://github.com/owncloud/core/issues/10838#issuecomment-54432238

But we faced now, that the URLs in the notification mails are mixed up with https and http links: The "logo-mail.gif" is always a http-link - regardless of what in "overwriteprotocol" is defined. The URL link to the shared file itself is just http, when ownCloud internal users are choosen through the autocomplete function while sharing the file on the website. https is used, when instead a reciepients emailadress is entered manually to share the file link.

Please remind, that on our ownCloud webserver, no SSL is configured for Apache2. So, the connection between ownCloud and the proxy is using HTTP and is therefore not secure. Just the connection between the external clients and the TMG Firewall is SSL encrypted and so using HTTPS.

MorrisJobke avatar Jan 09 '15 15:01 MorrisJobke

cc @LukasReschke You know that fancy reverse proxy and overwritehost config stuff. Did you ever tried the notification mail and verified the URL?

MorrisJobke avatar Jan 09 '15 15:01 MorrisJobke

I wonder how that is possible.

The URL is constructed using OC_Helper::makeURLAbsolute which is a fallback of \OCP\IURLGenerator::getAbsoluteURL. That function itself uses \OC_Request::serverProtocol to get the protocol which actually considers overwriteprotocol from the config.

<?php

session_write_close();
require_once('./lib/base.php');

var_dump(OC_Helper::makeURLAbsolute('/test.gif'));

With a custom protocol such as foo returns a foo:// URL on stable7 and master.

LukasReschke avatar Jan 09 '15 15:01 LukasReschke

My best bet is that the person borked it's overwritecondaddr setting which results in \OC_Request::isOverwriteCondition returning false.

LukasReschke avatar Jan 09 '15 15:01 LukasReschke

Doesn't seem so:

  'overwritecondaddr' => '^10\.0\.0\.30$',

MorrisJobke avatar Jan 09 '15 17:01 MorrisJobke

I believe @nickvergessen introduced a new config attribute for that: "overwrite.cli.url". Not sure if that's used for share mails though.

PVince81 avatar Jan 12 '15 10:01 PVince81

https://github.com/owncloud/core/blob/master/lib/private/urlgenerator.php#L166-L168 It's only used in CLI cases, I don't think the sharing emails are sent via CLI but directly.

nickvergessen avatar Jan 12 '15 11:01 nickvergessen

Any update on this?

RobinMcCorkell avatar Aug 21 '15 12:08 RobinMcCorkell

Any update ? @LukasReschke

PVince81 avatar Mar 01 '16 19:03 PVince81

Closing as obsolete. The config setting "overwrite.cli.url" should help with this.

PVince81 avatar Jul 06 '16 10:07 PVince81

the config setting "overwrite.cli.url" did the trick for me thanks

jonesints avatar Jul 07 '16 07:07 jonesints

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.

lock[bot] avatar Aug 04 '19 01:08 lock[bot]